package com.emou.test;

/**
 * Created by Emou on 2021/1/15
 */

public class Person implements A,B {
    private String name = "foreknow";
    private int id = 10001;
    @Override
    public void fly() {
        System.out.println("我会飞......");
    }

    @Override
    public void swim() {
        System.out.println("我会游泳......");
    }

    public void speak(String name){
        System.out.println("我的名字是 ： "+name+" ID: "+id);
    }

    public static void main(String[] args) {
        Person person = new Person();
        person.speak("tom");
        person.fly();
        person.swim();
        System.out.println("-----------------------");

        Class<?> str1 = person.getClass().getInterfaces()[0];
        Class<Person> str2 = (Class<Person>)person.getClass().getInterfaces()[1];

        System.out.println(str1);
        System.out.println(str2);
    }
}